package com.hxd.otc.module.wallet.presenter;

import android.support.annotation.NonNull;

import com.hxd.otc.base.BaseBean;
import com.hxd.otc.module.wallet.contract.CoinRechargeContrac;
import com.hxd.otc.module.wallet.model.WalletModel;
import com.hxd.otc.mvp.base.BasePresenter;
import com.hxd.otc.net.BaseObserver;

/**
 * Created by lzy on 2018/8/6 0006.
 * description ${添加钱包联系人 Presenter}
 */
public class CoinRechargePresenter extends BasePresenter<CoinRechargeContrac.View> implements CoinRechargeContrac.Presenter {

    private final WalletModel mModel;

    public CoinRechargePresenter(CoinRechargeContrac.View view) {
        super(view);
        mModel = WalletModel.getInstance();
    }

    @Override
    public void getRechargeCoinAddress(String addressId) {

        mModel.getRechargeCoinAddress(new BaseObserver() {
            @Override
            public void onNext(@NonNull String msg, @NonNull Object o) {

                mView.onSuccedd(o.toString());
            }

            @Override
            public void onError(int errType, @NonNull String errMessage) {

                mView.showToast(errMessage);
            }
        },mView.<BaseBean>bindAutoDispose(),addressId);
    }
}
